package com.zxlspace.collection2;

/**
 * 泛型接口：与继承同理
 * 重写方法随父类而定
 * @param <T>
 */
public interface Comparable<T> {
    void compare(T t);
}

/**
 * 同时檫除
 */
class Comp implements Comparable {

    @Override
    public void compare(Object o) {

    }
}

/**
 * 子类>=父类泛型
 * @param <T>
 */
class Comp1<T> implements Comparable {

    @Override
    public void compare(Object o) {

    }
}

class Comp2<T> implements Comparable<String> {

    @Override
    public void compare(java.lang.String string) {

    }
}

//父类檫除，子类泛型
class Comp3<T,T2> implements Comparable {

    @Override
    public void compare(Object o) {

    }
}

//父类泛型，子类>=父类
class Comp4<T,T2> implements Comparable<T> {

    @Override
    public void compare(T t) {

    }
}

class Comp5<T> implements Comparable{

    T name;

    @Override
    public void compare(Object o) {

    }
}

